#include <stdio.h>
int main(int argc,const char*argv[])
{
	if(argc<2){printf("缺少文件源\n");return -1;}
	int n=1,x;
	while(n<argc)
	{
		x=0;
		FILE*p=NULL;
		if((p=fopen(argv[n],"r"))==NULL){printf("%s",argv[n]);perror("\n打开文件失败:");return -1;}
		char t[2]="";
		while(fgets(t,2,p)!=NULL)
			if(t[0]=='\n')
				x++;
		printf("%s文件总行数为：%d\n",argv[n],x);
		fclose(p);
		n++;
	}
	return 0;
}
